package com.ruoyi.hmy.service.impl;

import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hmy.mapper.HmyShopsInfoMapper;
import com.ruoyi.hmy.domain.HmyShopsInfo;
import com.ruoyi.hmy.service.IHmyShopsInfoService;

import javax.annotation.Resource;

/**
 * 商户详情Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-15
 */
@Service
public class HmyShopsInfoServiceImpl extends ServiceImpl<HmyShopsInfoMapper,HmyShopsInfo> implements IHmyShopsInfoService {

    @Resource
    private HmyShopsInfoMapper hmyShopsInfoMapper;

    /**
     * 查询商户详情
     *
     * @param id 商户详情主键
     * @return 商户详情
     */
    @Override
    public HmyShopsInfo selectHmyShopsInfoById(Long id)
    {
        return hmyShopsInfoMapper.selectHmyShopsInfoById(id);
    }

    /**
     * 查询商户详情列表
     *
     * @param hmyShopsInfo 商户详情
     * @return 商户详情
     */
    @Override
    public List<HmyShopsInfo> selectHmyShopsInfoList(HmyShopsInfo hmyShopsInfo)
    {
        return hmyShopsInfoMapper.selectHmyShopsInfoList(hmyShopsInfo);
    }

    /**
     * 新增商户详情
     *
     * @param hmyShopsInfo 商户详情
     * @return 结果
     */
    @Override
    public int insertHmyShopsInfo(HmyShopsInfo hmyShopsInfo) {
        hmyShopsInfo.setCreateTime(LocalDateTime.now());
        return hmyShopsInfoMapper.insertHmyShopsInfo(hmyShopsInfo);
    }

    /**
     * 修改商户详情
     *
     * @param hmyShopsInfo 商户详情
     * @return 结果
     */
    @Override
    public int updateHmyShopsInfo(HmyShopsInfo hmyShopsInfo) {
        hmyShopsInfo.setUpdateTime(LocalDateTime.now());
        return hmyShopsInfoMapper.updateHmyShopsInfo(hmyShopsInfo);
    }

    /**
     * 批量删除商户详情
     *
     * @param ids 需要删除的商户详情主键
     * @return 结果
     */
    @Override
    public int deleteHmyShopsInfoByIds(Long[] ids) {
        return hmyShopsInfoMapper.deleteHmyShopsInfoByIds(ids);
    }

    /**
     * 删除商户详情信息
     *
     * @param id 商户详情主键
     * @return 结果
     */
    @Override
    public int deleteHmyShopsInfoById(Long id)
    {
        return hmyShopsInfoMapper.deleteHmyShopsInfoById(id);
    }
}
